package wps.component.elementsetting {
import flash.events.Event;

import mx.core.UIComponent;

import wps.component.IDrawingElement;
import wps.util.GeomUtil;

public class SettingRotatioinCircularSlider extends SettingCircularSlider {

    override protected function updateValue():void {
        // 角度只显示整数
        value = Math.round(target[targetProperty]);
    }

    override protected function changeHandler(e:Event):void {
        if (target && enabled) {
            var angle:Number = value - target.rotation;
            if (angle != 0) {
                GeomUtil.rotate(UIComponent(target), angle);

                var element:IDrawingElement = target as IDrawingElement;
                element.elementRotation = target.rotation;
            }
        }
    }

}

}
